Hello, |
Re: Baselines Module module_gen string n_mod string id_gen Link ll for o in all m do { for ll in all (o-> linkModule) do { cible= target(lien) module_gen= module(cible)// module_gen is a baseline nmod=name(module_gen) // module_gen is a baseline print nmod Id_gen=cible."PUID-V" print Id_gen "\n" // no output } } Why I can not print the content of my baseline attributes ?? could it be the fact that my target module is a baseline and not a current module ? Please Any ideas ? Thanks |
Re: Baselines izzo - Tue Sep 28 03:40:04 EDT 2010
To print the attribute values of your link target you need to use the correct functions: Module module (Link L) - gives you the link module for L ModuleVersion sourceVersion (Link) - gives you the module version that contains the source of the link ModuleVersion targetVersion (Link) - gives you the module version that contains the target of the link
Link L
Object o
for L in all (o->"*") do {
ModuleVersion mvTgt = targetVersion L
if (null data mvTgt) load(mvTgt, false) // open the target module
Object oTgt = target L
if (null oTgt) { print "Error when handling link ...\nHandle it!"; continue }
Module mTgt = module oTgt
// your code goes below ...
print "Handling link from " (fullName module o) ":" (identifier o) " --> " (fullName mTgt) ":" (identifier oTgt)
}
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: Baselines Mathias Mamsch - Tue Sep 28 03:51:39 EDT 2010
To print the attribute values of your link target you need to use the correct functions: Module module (Link L) - gives you the link module for L ModuleVersion sourceVersion (Link) - gives you the module version that contains the source of the link ModuleVersion targetVersion (Link) - gives you the module version that contains the target of the link
Link L
Object o
for L in all (o->"*") do {
ModuleVersion mvTgt = targetVersion L
if (null data mvTgt) load(mvTgt, false) // open the target module
Object oTgt = target L
if (null oTgt) { print "Error when handling link ...\nHandle it!"; continue }
Module mTgt = module oTgt
// your code goes below ...
print "Handling link from " (fullName module o) ":" (identifier o) " --> " (fullName mTgt) ":" (identifier oTgt)
}
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
It works When I compare baselines (File-Baseline-Compare) I have the below output : Added / Deleted Objects ==================== object #250 only exists in 3.0 object #251 only exists in 3.0 object #252 only exists in 3.0 object #253 only exists in 3.0 object #254 only exists in 3.0 object #255 only exists in 3.0 object #256 only exists in 3.0 object #257 only exists in 3.0 object #258 only exists in 3.0 object #259 only exists in 3.0 object #260 only exists in 3.0 The problem is that the absolute numbers are printed in a window . Is it possible to scan them and enter them into a 2D Table The problem is that I want do something automatic that could include all the list inside a table to get the corresponding objects and therefore print the OBJECT TEXT and the PUID from the concerned Baseline. Thank you |
Re: Baselines izzo - Tue Sep 28 05:41:15 EDT 2010
It is not so hard to compare the objects with a baseline. You should do your own routine: Skip skBaseline = createString() Skip skModule = createString() Object obj; Module modBaseline = null // set me to the baseline Module theModule = null // set me to the baseline for obj in modBaseline do put(skBaseline, obj."Absolute Number" "", obj) for obj in theModule do put(skModule , obj."Absolute Number" "", obj) for obj in skBaseline do if (!find (skModule, (key skBaseline) string)) print "Object " (key skBaseline) " was only found in " (versionString moduleVersion theModule) ".\n" for obj in skModule do if (!find (skBaseline, (key skBaseline) string)) print "Object " (key skBaseline) " was only found in current.\n"
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: Baselines -E- DXL: <Line:18> incorrect arguments for (do) -E- DXL: <Line:19> incorrect arguments for (do) -I- DXL: all done with 2 errors and 0 warnings Module m=current Object obj Skip skBaseline = createString() Skip skModule = createString() Baseline modBaseline=baseline(1,0,null) // set me to the baseline Baseline theBaseline=baseline(2,0,null) // set me to the baseline for obj in modBaseline do put(skBaseline, obj."Absolute Number" "",*obj*) //line 18 for obj in theBaseline do put(skModule, obj."Absolute Number" "",*obj*) //line 19, NO need to specify the position of the element ? for obj in skBaseline do if (!find (skModule, (key skBaseline) string)) print "Object " (key skBaseline) " was only found in " (versionString moduleVersion theModule) ".\n" for obj in skModule do if (!find (skBaseline, (key skBaseline) string)) print "Object " (key skBaseline) " was only found in current.\n" Thank you |
Re: Baselines |
Re: Baselines izzo - Wed Sep 29 05:26:26 EDT 2010
Yeah I did not take the time to syntactically correct the code, I thought it might give you the idea about how to determine deleted objects in a baseline. You need to set the Module variables to real modules (e.g. the current and a baseline).
Module m=current
Object obj
Skip skBaseline = createString()
Skip skModule = createString()
Module modBaseline=load(m, baseline(1,0,null), true)
if (null modBaseline) error "Baseline 1.0 was not found in module!"
for obj in modBaseline do put(skBaseline, obj."Absolute Number" "",obj)
for obj in m do put(skModule, obj."Absolute Number" "",obj)
Object obj2
for obj in skBaseline do {
if (!find (skModule, (key skBaseline) string, obj2)) {
print "Object " ((key skBaseline) string) " was purged in current.\n"
} else {
if (isDeleted obj && !isDeleted obj2) print "Object " (identifier obj) " was undeleted!"
if (!isDeleted obj && isDeleted obj2) print "Object " (identifier obj) " was deleted!"
}
}
for obj in skModule do
if (!find (skBaseline, (key skModule) string))
print "Object " ((key skModule) string) " was created in current.\n"
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: Baselines izzo - Wed Sep 29 05:27:20 EDT 2010
Hi, Module modBaseline=load(m, baseline(1,0,null), true)
if (null modBaseline) error "Baseline 1.0 was not found in module!"
Module modBaseline=load(m, baseline(1,0,null), true)
|
Re: Baselines 1- I did some modifications and I do not really understand why I got such an error, I just did Like it is writen in the DXL manuel. Object object( abso, module if not current module) I have 2 baselines here. 2- Is there something or an attribute that i can rely on to find out if the object Text has changed btw 2 Baselines. Thanks Again E- DXL: <Line:25> incorrect arguments for function (object) -E- DXL: <Line:41> incorrect arguments for function (object) -I- DXL: all done with 2 errors and 0 warnings Module m=current Object obj Object obj_v1,obj_v2 string PUID_v1,PIUD_v2 Skip skBaseline = createString() Skip skModule = createString() Module modBaseline=load(m, baseline(1,0,null), true) Module theBaseline=load(m,baseline(2,0,null),true) if (null modBaseline) error "Baseline 1.0 was not found in module!" if (null theBaseline) error "Baseline 2.0 was not found in module!" for obj in modBaseline do put(skBaseline, obj."Absolute Number" "",obj) for obj in theBaseline do put(skModule, obj."Absolute Number" "",obj) Object obj2 for obj in skBaseline do { if (!find (skModule, (key skBaseline) string, obj2)) { string abso=(key skBaseline) string print abso "\n" obj_v1=object(abso,modBaseline)// Doesnt work ? Line 25 incorrect arguments for function (object) weird PUID_v1=obj_v1."PUID" print PUID_v1"\n" print "Object " ((key skBaseline) string) " from baseline v 1 was purged in Baseline 2.\n" } else { if (isDeleted obj && !isDeleted obj2) print "Object " (identifier obj) " was undeleted!" if (!isDeleted obj && isDeleted obj2) print "Object " (identifier obj) " was deleted!" } } for obj in skModule do { if (!find (skBaseline, (key skModule) string)) { string abso_1=(key skModule) string print abso_1 "\n" obj_v2=object(abso_1,theBaseline) PUID_v2=obj_v2."PUID" print PUID_v2 "\n " print "Object " ((key skModule) string) " was created in Baseline 2.\n" } } |
Re: Baselines izzo - Wed Sep 29 09:42:20 EDT 2010 Object object ( int nr, Module m ) wants to have an integer not a string. Regards, Mathias Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: Baselines Thanks a lot |
Re: Baselines I combined your advice of this morning with yesterday code: It looks correct But I got this <Line:68> key used outside SkipList do loop -R-E- DXL: <Line:69> null intOf string parameter was passed How can I get my 2nd Skip list elements ? I tried to a 2nd loop but it did not work. It took a long time and Doors stopped 2 DB db = create "Show diff" DBE textbox = richText(db, "Text Modification", "", 200, 200, true) Buffer buff1 = create() Buffer buff2 = create() Buffer resBuf = create() string exigence_Text Module theBaseline=current Object obj Object obj_v1,obj_v2 string PUID_v2 string PUID_v1 Skip skBaseline = createString() Skip skModule = createString() Module modBaseline=load(theBaseline,baseline(3,0,null), true) if (null modBaseline) error "Baseline 3.0 was not found in module!" for obj in modBaseline do put(skBaseline, obj."Absolute Number" "",obj) for obj in theBaseline do put(skModule, obj."Absolute Number" "",obj) for obj in skModule do { if (find (skBaseline, (key skModule) string)) { string abso_1=(key skModule) string string abso_2=(key skBaseline) string //-R-W- DXL: <Line:68> obj_v1=object(intOf(abso_2),theBaseline) obj_v2=object(intOf(abso_1),theModule) string date1= obj_v2."Last Modified On" string date2=obj_v1."Last Modified On" print date1 " " date2 "\n" PUID_v2=obj_v2."PUID" if(PUID_v2!=null){ if(date2!=date1) { buff1=obj_v1."Object Text" buff2=obj_v2."Object Text" diff(resBuf, buff1, buff2, "\\cf1\\strike ", "\\cf3\\ul ") //print "Object " ((key skModule) string) " was created in Baseline 2.\n" } } } } |
Re: Baselines |
Re: Baselines izzo - Thu Sep 30 08:26:47 EDT 2010 Secondly, you should try to find the reasons for those obvious errors (like syntax errors) yourself. The forum cannot replace a DXL training or studying of the DXL manual. At least try to narrow the reason of the error down, don't just post the complete source code, unless you really see no other option. At least when you have general DXL questions (like is there a function for XY) because you are writing a script like "Compare Baselines", try asking those questions in one post and do not create a new post for every question. In my opinion the error message "key used outside SkipList do loop" is pretty obvious to get, when you think about what the key function does. It means you cannot call (key someSkip) when you did not do "for value in someSkip". In your case you want to get the key for skBaseline but iterate over skModule. It seems to me you did not completly get what my example does: It stores the objects of the two modules in two skip lists using "Absolute Number" as a key, and the object as the "Value". So provided you have an object in the baseline (that has the same absolute number as the object in the module), how do you think you will get the object with the same absolute number in the other module? Regards, Mathias Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: Baselines But what I meant in my last post is that I want to get 2 elements, thus 2 absolutes numbers so after I can compare text from differents modules or baselines. I tried to do 2 consecutive loops and it did not work. |
Re: Baselines |
Re: Baselines My script does not print all the Object Texts, it only shows the last element put in the buffers. How can I print all the Objects Texts and their differences ? Thanks DB db = create "Show diff" DBE textbox = richText(db, "Text Modification", "", 200, 200, true) Buffer exitext = create() Buffer exittext = create() Buffer resBuf = create() for loop { exitext=obj_v1."Object Text" exittext=obj_v2."Object Text" diff(resBuf, exitext,exittext, "\\cf1\\strike ", "\\cf3\\ul ") } realize db useRTFColour(textbox, true) set(textbox, tempStringOf resBuf) show db delete resBuf delete exittext delete exitext |
Re: Baselines |
Re: Baselines izzo - Fri Oct 01 06:28:34 EDT 2010 DB db = create "Show diff" DBE textbox = richText(db, "Text Modification", "", 200, 200, true) Buffer Buffer1 = create() Buffer Buffer2 = create() Buffer resBuf = create() for loop { string exitext=obj_v1."Object Text" string exittext=obj_v2."Object Text" Buffer1+=exitext Buffer2+=exittext diff(resBuf, Buffer1,Buffer2, "\\cf1\\strike ", "\\cf3\\ul ") } realize db useRTFColour(textbox, true) set(textbox, tempStringOf resBuf) show db delete resBuf delete Buffer1 delete Buffer2 |
Re: Baselines Does anyone know how to link a DBE element as a tab to a textbox ? I tried what is below: my textbox is not connected to the first Tab Thanks a lot string gpChoices[2] = {"test1","test2"} void fnDoNothingDBE(DBE xDBE) {} string gpNothing[1] = {"Nothing"} DB db = create "Show diff" DBE dbTab = tab(db,gpChoices,2,fnDoNothingDBE) DBE textbox = richText(db, "", "", 200, 200, true) textbox->"top"->"inside"->dbTab textbox->"left"->"inside"->dbTab textbox->"right"->"inside"->dbTab textbox->"bottom"->"inside"->dbTab diff(resBuf, Buffer1,Buffer2, "\\cf1\\strike ", "\\cf3\\ul ") realize db void fnChooseTab(DBE xTab) { int i = get(xTab) if(i==0) { show(textbox) } elseif(i==1) { //show() } } useRTFColour(textbox, true) set(textbox, tempStringOf resBuf) set(dbTab,fnChooseTab) delete resBuf delete Buffer1 delete Buffer2 show db |
Re: Baselines |
Re: Baselines izzo - Mon Oct 04 08:21:16 EDT 2010
You need to manually "hide" and "show" the elements of your GUI that shall appear on each tab. Regards, Mathias
// use:{code } ...code...{code }...
// in your posts to make them formatted like this
// but remove the spaces after 'code'
Buffer Buffer1 = create(); Buffer1 = "Hello this is a test!"
Buffer Buffer2 = create(); Buffer2 = "Hello that was a test!"
Buffer resBuf = create()
string gpNothing[1] = {"Nothing"}
string gpChoices[2] = {"test1","test2"}
void fnDoNothingDBE(DBE xDBE) { }
DB db = create "Show diff"
DBE dbTab = tab(db,gpChoices,2,fnDoNothingDBE)
dbTab->"top"->"form"; dbTab->"bottom"->"form";
dbTab->"right"->"form"; dbTab->"left"->"form"
DBE textbox = richText(db, "", "", 200, 200, true)
textbox->"top"->"inside"->dbTab; textbox->"left"->"inside"->dbTab
textbox->"right"->"inside"->dbTab; textbox->"bottom"->"inside"->dbTab
diff(resBuf, Buffer1,Buffer2, "\\cf1\\strike ", "\\cf3\\ul ")
void fnChooseTab(DBE xTab) {
int i = get(xTab)
if(i==0) {
show(textbox)
} else if(i==1) {
hide(textbox)
}
}
useRTFColour(textbox, true)
set(textbox, tempStringOf resBuf)
set(dbTab,fnChooseTab)
delete resBuf
delete Buffer1
delete Buffer2
show db
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: Baselines I have a Dialog Box interface who takes baselines and modules as input parameters. The first time I click on the button to call my function, I do not have any error. If I click a 2nd time on the button, I have errors such null Object parameter was passed into argument position 1. When I close my dialog box and execute the code again I do not have any errors. Please any ideas ? |
Re: Baselines izzo - Mon Oct 11 03:52:48 EDT 2010 Just a guess, maybe one of the objects or modules you pass is the current Object/Module? Object and Module Handles will become invalid, when you close the module they are contained in. The current Object / Module changes frequently, for example when opening any module from code. A good way to go about this, is: // do this at the beginning of your code Module mCur = current Object oCur = current
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: Baselines Mathias Mamsch - Mon Oct 11 06:55:34 EDT 2010 Just a guess, maybe one of the objects or modules you pass is the current Object/Module? Object and Module Handles will become invalid, when you close the module they are contained in. The current Object / Module changes frequently, for example when opening any module from code. A good way to go about this, is: // do this at the beginning of your code Module mCur = current Object oCur = current
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
1)I tried, but it did not work.. I closed all the none-current modules who were open at the end of the code. But it did not change anything. So I always have the same problem, I need to close the input dialog box. 2) I aslo realised that each time I execute my code the results of the t-1 execution is concatenated with the t execution in the output dialog box. I tried to empty my lists empty(list), did not work. Do I copy paste the script? Thanks |
Re: Baselines izzo - Wed Oct 13 08:54:30 EDT 2010 Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: Baselines Mathias Mamsch - Wed Oct 13 09:13:41 EDT 2010 Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS Thanks Attachments attachment_14542383_historique_avec_interface.txt |
Re: Baselines izzo - Thu Oct 14 04:04:39 EDT 2010 |
Re: Baselines izzo - Fri Oct 15 08:01:30 EDT 2010 Ok some general remarks:
for obj in skModule do {
if (find (skBaseline, (key skModule) string), obj2) {
// string abso_1= (key skModule) string -> don't need me
// obj_v1=object(intOf(abso_1),b1) -> is the same as obj
// obj_v2=object(intOf(abso_1),b2) -> is the same as obj2
string nameb=name(b1)
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: Baselines |
Re: Baselines |